package cate.game.farm;

import cate.game.GameBody;
import cate.game.farm.local.FarmLocalManager;
import cate.game.farm.local.cross_boss.CrossBossManager;
import cate.game.framework.ModuleMan;
import cate.game.role.farm.PlayTimesHandler;
import cp.solution.ops.status.ModOprStatus;
import easy.java.dev.note.NoteField;

/** farm玩法模块 */
public class FarmManager extends ModuleMan {
    /** 本服玩法管理 */
    public FarmLocalManager local = new FarmLocalManager();

    @NoteField("跨服BOSS管理")
    public CrossBossManager crossBoss = new CrossBossManager();

    public PlayTimesHandler playTimesHandler = new PlayTimesHandler();

    @Override
    public void initIndependent(GameBody game) throws Exception {
        super.initIndependent(game);
        local.initIndependent(game);
        crossBoss.initIndependent(game);
    }

    @Override
    public void initDependent() throws Exception {
        local.initDependent();
        crossBoss.initDependent();
    }

    @Override
    public void shutdown(){
        local.shutdownSafe();
    }

    @Override
    public void onDaySpan(){
        local.onDaySpanSafe();
    }

    @Override
    public void onWeekSpan() {
        local.onWeekSpanSafe();
    }

    @Override
    public ModOprStatus handleMergeSettle(){
        return new ModOprStatus("副本管理").exe(() -> {
            local.handleMergeSettle();
        });
    }
}
